<!-- INCLUDE header.html -->
<link rel="stylesheet" href="{VIEW_ROOT}js/cloud-zoom.css" type="text/css" media="screen" />
<script src="{VIEW_ROOT}js/cloud-zoom.1.0.2.min.js"></script>
<div id='content'>
	<!-- INCLUDE left.html -->
	<div id="right">
		<div class="page-title">{$p['name']}</div>
		<div class="page-wrapper">
			<div class="detail-info">
				<div class="detail-image">
					<a id="zoom1" class="cloud-zoom" href="{array_shift(explode('|',$p['image']))}" rel="adjustX:10, adjustY:-4,zoomWidth:300,zoomHeight:300">
						<img alt="" src="{thumb(array_shift(explode('|',$p['image'])),300,300,'box')}" >
					</a>
					<ul class="detail-thumbs">
					{foreach(explode('|',$p['image']) as $img)}
						<li>
							<a 
							rel="useZoom: 'zoom1', smallImage: '{thumb($img,300,300,'box')}' "  
							class="cloud-zoom-gallery" 
							href="{$img}">
								<img src="{thumb($img,50,50)}" />
							</a>
						</li>
					{/foreach}
					</ul>
				</div>

				{if($_SESSION['user'] && $_SESSION['user']['status'] == 2)}
					Wholesale Price: <span class="price">${$p['wholesale']}</span><br />
				{else}
					Retail Price: <span class="price">${$p['retail']}</span><br />
				{/if}
				
				Weight: {$p['weight']} lbs<br />
				
				{if($p['brand'])}
				Brand: {$p['brand']}<br />
				{/if}
				
				{if($p['carrier'])}
				Carrier: {$p['carrier']}<br />
				{/if}
				
				
				Qty:<select id="qty">
						<option value="1">1</option>
						<option value="2">2</option>
						<option value="3">3</option>
						<option value="4">4</option>
						<option value="5">5</option>
						<option value="6">6</option>
						<option value="7">7</option>
						<option value="8">8</option>
						<option value="9">9</option>
						<option value="10">10</option>
				</select><br />
				<a href="javascript:add_to_cart({$p['product_id']});"><img src="{VIEW_ROOT}images/add-to-cart.gif" /></a>
			</div>
			<div class="detail-content">
				{$p['content']}
			</div>
			<div class="clear"></div>
		</div>
	</div>
	<div class="clear"></div>
</div>
<script>
function add_to_cart(pid)
{
	$.post('?p=cart&action=add',{ pid:pid,qty:$('#qty').val() },function()
	{
		window.location = '?cart';
	});
}
</script>
<!-- INCLUDE footer.html -->